<html>
<head>
   <link href="/Apprentice_CMS/skin/frontend/default.css" rel="Stylesheet" type="text/css" />
   <link href="/Apprentice_CMS/css/frontend/all.min.css" media="screen" rel="stylesheet" type="text/css">
   <script type="text/javascript" src="/Apprentice_CMS/js/frontend/jquery.min.js"></script>
   <script type="text/javascript" src="/Apprentice_CMS/js/frontend/jquery.json.min.js"></script>
   <script type="text/javascript" src="/Apprentice_CMS/js/frontend/jquery.ajaxq.min.js"></script>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />	
	<?php echo $this->headTitle('View the article') ?>	
	<?php echo $this->headLink() ?>
	<?php echo $this->headStyle()?>
	<?php echo $this->headScript() ?>
</head>
<body data-rendering="true">
	<div id="wrapper">
		<div id="header">
			<div class="container_12">
				<div class="grid_4">
					<h1>
						<a href="/Apprentice_CMS/public/">Apprentice CMS</a>
					</h1>
				</div>
			</div>
		</div>
		<div id="container" class="container_12">
			<div class="widget_container grid_12 t_space_bottom" id="container_1"></div>
			<div class="widget_container grid_12 t_space_bottom" id="container_2"></div>
			<div class="widget_container grid_12 t_space_bottom" id="container_3">
				<div class="widdget_container grid_9 alpha" id="container_4">
					<div class="widget" id="container_4_1">
						<div class="t_news_breadcrumb">
							<h2>
								<span><a href="/Apprentice_CMS/public/">Home</a></span>
								/
								<span><a href="/Apprentice_CMS/public/news/category/view/id/<?php echo $this->category['category_id']?>"><?php echo $this->category['name']?></a></span>
							</h2>
						</div>
					</div>
					<div class="widget" id="container_4_2">
						<div class="t_utility_textresizer">
							Text size:
							<span>
								<a class="smaller" href="javascript: void(0);">
									A
									<sup>-</sup>
								</a>
							</span>
							<span>
								<a class="default" href="javascript: void(0);">
									A
								</a>
							</span>
							<span>
								<a class="larger" href="javascript: void(0);">
									A
									<sup>+</sup>
								</a>
							</span>
						</div>
					</div>
					<div class="t_news_details">
						<h2><?php echo $this->article['title']?></h2>
						<cite>
							<?php echo $this->article['author']?> - 
							<?php echo $this->article['updated_date']?>	
						</cite>
						<div class="description">
							<p><?php echo $this->article['description']?></p>
						</div>
						<div class="content">
							<p><?php echo $this->article['content']?></p>
						</div>
					</div>
					<div class="widget" id="container_4_3"></div>
					<div class="widget" id="container_4_4"></div>
					<div class="widget" id="container_4_5">
						<div class="t_tag_tags">
							<h2>Từ khóa</h2>
							<span>
								<?php echo $this->slug?>
							</span>
						</div>
					</div>
					<div class="widget" id="container_4_6">
						<div class="t_comment_comment" id="tCommentComment">
							<h2>Bình luận</h2>
							<div id="comment">
								<?php
								$has_comment = false;
								while ($row = $this->comments->fetch()) {
									if ($row['is_active'] == 1) {
										$has_comment = true;
										echo "<strong>" . $row['title'] . "</strong><br />";
										echo $row['content'] . "<br />";
										$full_name = $row['full_name'];
										$email = $row['email'];
										echo "
											<strong>$full_name | $email</strong>
										";
										echo "<cite> at " . $row['created_date'] . "</cite><br />";
										echo "------------------------------------------<br/>";
									}
								}
								if ($has_comment == false) {
									echo "There are no comments available.";
								} 
								?>
							</div>
							<div id="tCommentFormContainer">
								<?php
								if ($this->allowComment == 1) {
									$article_id = $this->id;
									echo "<h2 class='title'>Viết bình luận của bạn</h2><div></div>
										<a name='commentForm'></a>";
									echo "
										<form action='/Apprentice_CMS/public/comment/admin/add' method='post' name='sendCommentForm' id=sendCommentForm' class='form' enctype='multipart/form-data'>
										<div class='clearfix'>
											<label>Tên đầy đủ: </label>
											<input type='text' name='name_comment' id='name_comment' style='width: 250px; padding: 3px 0' />
										</div>
										<div class='clearfix'>
											<label>Email:</label>
											<input type='text' name='email_comment' id='email_comment' style='width: 250px; padding: 3px 0' />
										</div>
										<div class='clearfix'>
											<label>Title:</label>
											<input type='text' name='title_comment' id='title_comment' style='width: 250px; padding: 3px 0' />
										</div>
										<div class='clearfix'>
											<div><label>Nội dung</label></div>
											<div>
												<textarea name='content_comment' cols='30' rows='10'
													style='width:400px; height: 150px;'
												></textarea>
											</div>
										</div>
										<div class='clearfix'>
                                            <label> </label>
											<img id='captcha' src='/Apprentice_CMS/library/securimage/securimage_show.php' alt='CAPTCHA Image' />
                                            <a href='#' title='Refresh Image' onclick='document.getElementById(\"captcha\").src = \"/Apprentice_CMS/library/securimage/securimage_show.php?\" + Math.random(); return false'><img src='/Apprentice_CMS/library/securimage/images/refresh.png' /></a>
                                        </div>
                                        <div class='clearfix'>
                                            <label>Mã xác nhận: </label>
                                            <input type='text' name='captcha_code' id='captcha_code'/> (*)
										</div>
										<div class='clearfix'>
											<label> </label>
											<input type='submit' id='tCommentSendButton' class='' name='send' value='Gửi' />
										</div>										
										<input type='hidden' name='article_id' id='article_id' value='$article_id' />
										</form>";
								}
							?>
							</div>
						</div>
					</div>
				</div>
				<div class="widdget_container grid_3 omega" id="container_5">
					<div class="widget" id="container_5_1">
						<div class="t_news_newer">
							<h2>Các tin mới hơn</h2>
							<ul>
								<?php 
									$i = 0;
									foreach ($this->article_newers as $value) {
										if ($i > $this->number_newer) {
											break;
										}else{
											$article_idX = $value['article_id'];
											$titleX = $value['title']; 
											echo "
											<li>
												<a href='/Apprentice_CMS/public/news/article/view/$article_idX'>
												$titleX
												</a>
											</li>
											";
										}										
									}
								?>
							</ul>
						</div>
					</div>
				<div class="widget" id="container_5_2"></div>
				</div>
			</div>
			<div class="clearfix"></div>
		</div>
		<div id="footer">
			<div class="container_12">
				<div>
					<a href="https://groups.google.com/group/apprentice_pm?hl=vi" title="Powered by Apprentice_CMS" 
					target="_blank">Powered by Apprentice_CMS</a>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>	</div>
	
</body>
	
</html>